load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "invertedidx",
    srcs = [
        "geo.go",
        "inverted_index_expr.go",
        "json_array.go",
        "trigram.go",
        "tsearch.go",
    ],
    importpath = "github.com/cockroachdb/cockroach/pkg/sql/opt/invertedidx",
    visibility = ["//visibility:public"],
    deps = [
        "//pkg/geo",
        "//pkg/geo/geogfn",
        "//pkg/geo/geographiclib",
        "//pkg/geo/geoindex",
        "//pkg/geo/geopb",
        "//pkg/geo/geoprojbase",
        "//pkg/sql/catalog/descpb",
        "//pkg/sql/inverted",
        "//pkg/sql/opt",
        "//pkg/sql/opt/cat",
        "//pkg/sql/opt/constraint",
        "//pkg/sql/opt/idxconstraint",
        "//pkg/sql/opt/invertedexpr",
        "//pkg/sql/opt/memo",
        "//pkg/sql/opt/norm",
        "//pkg/sql/opt/props",
        "//pkg/sql/rowenc",
        "//pkg/sql/sem/eval",
        "//pkg/sql/sem/tree",
        "//pkg/sql/sem/tree/treecmp",
        "//pkg/sql/types",
        "//pkg/util/encoding",
        "//pkg/util/json",
        "//pkg/util/trigram",
        "@com_github_cockroachdb_errors//:errors",
        "@com_github_golang_geo//r1",
        "@com_github_golang_geo//s1",
        "@com_github_golang_geo//s2",
    ],
)

go_test(
    name = "invertedidx_test",
    size = "small",
    srcs = [
        "geo_test.go",
        "inverted_index_expr_test.go",
        "json_array_test.go",
        "trigram_test.go",
        "tsearch_test.go",
    ],
    embed = [":invertedidx"],
    deps = [
        "//pkg/geo",
        "//pkg/geo/geoindex",
        "//pkg/geo/geopb",
        "//pkg/settings/cluster",
        "//pkg/sql/inverted",
        "//pkg/sql/opt",
        "//pkg/sql/opt/norm",
        "//pkg/sql/opt/testutils",
        "//pkg/sql/opt/testutils/testcat",
        "//pkg/sql/sem/eval",
        "//pkg/sql/sem/tree",
        "//pkg/sql/types",
        "//pkg/util/encoding",
        "@com_github_stretchr_testify//require",
    ],
)
